package com.hefei.hight;

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * @author caizhengjun
 * @date 2020/9/4 9:13 下午
 */
public class Test07 {
    public static void main(String[] args) {
        LocalTime localTime = LocalTime.now();
        LocalTime localTime1 = LocalTime.of(15, 23, 32);

        Duration duration = Duration.between(localTime1, localTime);
        System.out.println(duration);

        System.out.println(duration.getSeconds());
        System.out.println(duration.getNano());

        //System.out.println(duration.toDays());

        LocalDateTime localDateTime = LocalDateTime.of(2021, 3, 28, 8, 8, 8);
        LocalDateTime localDateTime1 = LocalDateTime.now();

        Duration between = Duration.between(localDateTime1, localDateTime);

        System.out.println(between.toDays());
    }
}
